New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test minitest integration #445
Conversation
could you add a check list or some ideas what may need to be added here? |
Will do. Right now it needs someone who tests it on a non trivial project, that has real unit tests. That will likely be myself. And I'm blocked by time right now. |
I'll play with it today on sidekiq's suite. |
I tried with sidekiq for maybe 10min back one month or so. But could not isolate a test / subject set that is a "real unit" test for testing the rspec integration. By that I mean that most of the tests (and maybe even the global setup, I do not recall precicely) require redis / and or cause side effects. You should start with Conceptually I think that sidekiq might not be the best project to verify the mutant-minitest integration. Since its domain is mostly managing nondeterministic things (threads, network, ...). Not that I think sidekiq and mutant "cannot" play well together, but I think its at too big step. It would be easier to start with a smaller lib that does not have IO etc to validate the integration is correct, before using the integration on something bigger and running into false positives that burn time. |
How would I try this out? |
No time at all sorry. Someone with a less "global state hitting" minitest project should try. |
I mean just, how would I invoke this from the command line? |
|
I gave it a try on a Rails project, and it executed part-way but then had an error: RAILS_ENV=test bundle exec mutant -r ./config/environment -I test --use minitest Agency Output:
(etc.) |
Likely this is triggered from missing autoload triggers. Typical rails symptom. Try to explicitly require the file that defines that method. Or ideally test on a non rails project. |
It seems that Mutant expects the missing method # Cover expression syntaxes
#
# @return [Array<String>]
#
# @api private
def expression_syntax
klass.cover_expression
end |
@dogweather Ahh, I remember see the discussion in #330. |
Depends on #508 from software rusting. |
ebe513a
to
5262a1e
Compare
e431695
to
8315a4d
Compare
lib/mutant/integration/minitest.rb
Outdated
output = StringIO.new | ||
reporter = ::Minitest::SummaryReporter.new(output) | ||
|
||
start = Time.now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would align the assignment operators here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of recording Time.now
and doing Time.now - start
later could you use Benchmark.realtime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@backus I agree, that is a much better idea.
Another nice side benefit is that you eliminate some extra noise from StringIO#rewind
and StringIO#read
since you could wrap the passed = test_cases.all? { |test| test.call(reporter) }
line only.
hi @mbj! I know you haven't looked at this in a while, but would you mind if I took over this work? I've been able to get this running on my local apps, the only real work I did was add https://github.com/tubbo/mutant/tree/feature/minitest-integration |
I'd be super happy if you did so. Feel free to open a fresh PR. I'd close this one and reference it. |
6bc8af0
to
cc02977
Compare
So the news is I've got a sponsor for moving this feature into a released version:
|
03e8107
to
5917ad2
Compare
Prelimiary results are good, AUOM is fully covered. I do want to polish the cover expression mechanism a bit more, and possibly add a bit better "selection reporting" before release. |
This is on how an mutant minitest integration may look like: mbj/auom#19 |
7b6a32f
to
3b1e78a
Compare
0ac8999
to
1d1e544
Compare
1d1e544
to
9ceb2bd
Compare
There is a pre-release on rubygems. The "official" release is pending, will be paired with better docs. Version will than jump to the mutant version, which is 0.8.19 as time of writing this. I'd apprechiate the following:
|
[fix #92]
References: #330.